<?php
namespace api\modules\v1\controllers;

use Yii;
use api\common\controllers\Controller;
use api\modules\v1\models\LoginForm;
use api\modules\v1\models\LogingzhForm;
use common\records\UserInfo;

class PriceController extends Controller
{
    public function actionTrade()
    {
        if(!array_key_exists("money",$_GET) )
        {
            $result = array();
            $detail = array();

            $detail['code'] = 400;
            $detail['reason'] = "fields missing";
            $result['result'] = $detail;
            return $result;
        }

        $money = trim($_GET['money']);
        $coin = $money*5;

        $result = array();
        $detail = array();

        $detail['code'] = 200;
        $detail['reason'] = "success";
        $detail['coin'] = intval($coin);

        $result['result'] = $detail;
        return $result;
    }
}
